#include "./message.hpp"

namespace qbe::msg {

//void ref_event_send_test(ecs::EventWriter<RefUpdateEvent> event) {
//  event.send(RefUpdateEvent{1});
//};

void test_event_send(ecs::EventWriter<TestEvent> event) {
  event.send(TestEvent{1});
};
void test_event_recv(ecs::EventReader<TestEvent> events) {
  auto it = events.read();
  for (auto e : events) {
    // SPDLOG_INFO("recv test event: {}", e.code);
  }
};
void test_event_clear(ecs::Res<ecs::Event<TestEvent>> res) {
  res.get().clear();
};

// 清除所有消息
void clear_msgs(ecs::Query query) {
  query.get_resource<ecs::Event<RenderEvent>>().clear();
  query.get_resource<ecs::Event<TestEvent>>().clear();

  query.get_resource<ecs::Event<undoRedoT::Event>>().clear();
}

}  // namespace qbe::msg